package org.hawk.gwtppc.webtest.tests.mock;

import com.google.gwt.dom.client.Document;
import com.google.gwt.dom.client.Style.Unit;
import com.google.gwt.layout.client.Layout;
import com.google.gwt.layout.client.Layout.AnimationCallback;
import com.google.gwt.layout.client.Layout.Layer;
import com.google.gwt.user.client.ui.AnimatedLayout;
import com.google.gwt.user.client.ui.ComplexPanel;
import com.google.gwt.user.client.ui.LayoutCommand;
import com.google.gwt.user.client.ui.ProvidesResize;
import com.google.gwt.user.client.ui.RequiresResize;
import com.google.gwt.user.client.ui.Widget;
/**
 * This class was unable to compile so check it under webtests:
 */
public class DockLayoutPanel extends ComplexPanel implements AnimatedLayout,
		RequiresResize, ProvidesResize {

	/**
	 * Used in {@link DockLayoutPanel#addEast(Widget, double)} et al to specify
	 * the direction in which a child widget will be added.
	 */
	public enum Direction {
		NORTH, EAST, SOUTH, WEST, CENTER, LINE_START, LINE_END
	}

	/**
	 * Layout data associated with each widget.
	 */
	protected static class LayoutData {
		public Direction direction;
		public double oldSize, size;
		public double originalSize;
		public boolean hidden;
		public Layer layer;

		public LayoutData(Direction direction, double size, Layer layer) {
			this.direction = direction;
			this.size = size;
			this.layer = layer;
		}
	}

	private class DockAnimateCommand extends LayoutCommand {
		public DockAnimateCommand(Layout layout) {
			super(layout);
		}

		@Override
		protected void doBeforeLayout() {

		}
	}

	final Unit unit;
	Widget center;
	final Layout layout;
	final LayoutCommand layoutCmd;

	/**
	 * Creates an empty dock panel.
	 * 
	 * @param unit
	 *            the unit to be used for layout
	 */
	public DockLayoutPanel(Unit unit) {
		this.unit = unit;

		setElement(Document.get().createDivElement());
		layout = new Layout(getElement());
		layoutCmd = new DockAnimateCommand(layout);
	}

	public void onResize() {

	}

	public void animate(int duration) {

	}

	public void animate(int duration, AnimationCallback callback) {

	}

	public void forceLayout() {

	}
}